<?php
//admin后台
Route::Group(['namespace' => 'Home'], function () {
    Route::get('/', "IndexController@index");

    //登录注册
    Route::match(['get', 'post'], '/login', "UserController@login");
    Route::match(['get', 'post'], '/register', "UserController@register");
    //退出登录
    Route::get('loginout', "UserController@loginout");

    //分类
    Route::get('category/{id}', "CategoryController@index");

    //详情
    Route::get('goods/{id}', "GoodsController@index");

    //购物车
    Route::get('cart', "CartController@index");
    //添加购物车
    Route::post('addcart', "CartController@addcart");
    //更新购物车
    Route::post('upcart', "CartController@upcart");
    //删除购物车
    Route::post('delcart', "CartController@delcart");

    //订单
    Route::group(['middleware' => ['CheckHomeLogin']], function () {
        Route::match(['get', 'post'], 'order', "OrderController@order");
        Route::match(['get'], 'ordersuccess/{oid}', "OrderController@orderSuccess");
        Route::match(['get'], 'orderlist', "OrderController@orderlist");
        Route::match(['get'], 'pay/{id}', "OrderController@pay");
        Route::match(['get'], 'changeorder/{id}/{status}', "OrderController@changeorder");
        Route::match(['post'], 'adress', "AdressController@index");
        Route::match(['get'], 'adressdel/{id}', "AdressController@adressdel");
    });


});

